Socket
Socket
Sign inDemoInstall

bigint-isqrt

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bigint-isqrt

Square root of BigInts


Version published
Maintainers
2
Created
Source

bigint-isqrt

======================

NPM

======================

example:

var sqrt = require('bigint-isqrt');

var r1 = BigInt('25');
console.log("Square root of 25 = ",sqrt(r1));//Square root of 25 = 5

r1 = BigInt('82120471531550314555681345949499512621827274120673745141541602816614526075010755373654280259022317599142038423759320355177481886719814621305828811322920076213800348341464996337890625');
console.log(sqrt(r1));//9062034624274524065844376014975805577107171799890766992670739972241112960081909332275390625n

//No error with negative numbers
//You should take care of `BigInt` to be not negative number.
//No built-in checks for this are implemented.
//This function had been made as the fastest way to count square root

r1 = BigInt('-25');
console.log(sqrt(r1));//-25n

Keywords

FAQs

Package last updated on 17 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc